package com.crm.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.crm.domain.BusinessOpportunity;
import com.crm.crm.domain.dto.business.BusinessListDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@Mapper
public interface BusinessMapper extends BaseMapper<BusinessOpportunity> {

    @Update("update business_opportunity set owner =#{owner} where id=#{id}")
    void updateOwner(String owner, Integer id);
    @Select("select count(*) from business_pool where owner = #{userName}")
    Long selectBusinessPoolNum(String userName);
    @Select("select count(*) from business_opportunity where owner = #{userName}")
    Long selectBusinessNum(String userName);
    @Select("select id from business_opportunity where owner = #{name}")
    List<Integer> selectIds(String name);

    void setOwner(List<Integer> ids, String name);
}
